<template>
  <div>
    <div
      class="col-md-12"
      style="border-top: 1px solid #ccc; border-bottom: 1px solid #ccc"
    >
        <el-col :span="16" style="padding-left: 20px">
          <el-tooltip
            class="item"
            effect="dark"
            content="选择要显示的列"
            placement="top"
          >
            <el-popover placement="bottom" width="300" trigger="click">
              <el-col :span="12">
                <el-checkbox
                  v-model="showCustomerCode"
                  @change="showHide('showCustomerCode')"
                  >客户代码
                </el-checkbox>
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showCustomerStatus"
                  @change="showHide('showCustomerStatus')"
                  >客户状态
                </el-checkbox>
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showCustomerCate"
                  @change="showHide('showCustomerCate')"
                  >客户类别
                </el-checkbox>
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showCreditRank"
                  @change="showHide('showCreditRank')"
                  >客户信用等级
                </el-checkbox>
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showCreditLine"
                  @change="showHide('showCreditLine')"
                  >授信额度
                </el-checkbox>
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showCapital"
                  @change="showHide('showCapital')"
                  >注册资金</el-checkbox
                >
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showAnnualSales"
                  @change="showHide('showAnnualSales')"
                  >年销售额
                </el-checkbox>
              </el-col>
              <el-col :span="12">
                <el-checkbox v-model="showBank" @change="showHide('showBank')"
                  >对公银行账号</el-checkbox
                >
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showCertificateNo"
                  @change="showHide('showCertificateNo')"
                  >开户银行
                </el-checkbox>
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showAddress"
                  @change="showHide('showAddress')"
                  >税务登记证号
                </el-checkbox>
              </el-col>
              <el-col :span="12">
                <el-checkbox v-model="showArea" @change="showHide('showArea')"
                  >地址</el-checkbox
                >
              </el-col>
              <el-col :span="12">
                <el-checkbox v-model="showBrand" @change="showHide('showBrand')"
                  >经营面积</el-checkbox
                >
              </el-col>
              <el-col :span="12">
                <el-checkbox
                  v-model="showBankAccount"
                  @change="showHide('showBankAccount')"
                  >模拟，对应列表的列项
                </el-checkbox>
              </el-col>
              <el-button
                size="small"
                slot="reference"
                type="plain"
                class="setting"
              >
                <div style="display: flex; flex-direction: column">
                  <i class="el-icon-setting"></i>
                  <span style="margin-top: 3px">显示设置</span>
                </div>
              </el-button>
            </el-popover>
          </el-tooltip>

          <el-button
            @click="handleImport(3)"
            size="small"
            style="margin-top: 10px; margin-bottom: 10px; margin-left: 10px"
            type="plain"
            class="setting"
          >
            <div style="display: flex; flex-direction: column">
              <i class="el-icon-setting"></i>
              <span style="margin-top: 3px">上报审批</span>
            </div>
          </el-button>
          <el-input
            placeholder
            v-model="inputSearch"
            class="input-with-select input-search"
            style="margin-left: 10px; width: 450px; height: 47px; top: 9px"
            speech
            x-webkit-speech
            size="large"
          >
            <el-select
              v-model="selectsearch"
              slot="prepend"
              placeholder="请选择"
            >
              <el-option label="客户名称" value="1"></el-option>
              <el-option label="订单号" value="2"></el-option>
              <el-option label="审批状态" value="3"></el-option>
              <el-option label="物品名称" value="4"></el-option>
              <el-option label="物品类别" value="7"></el-option>
              <el-option label="序号id" value="5"></el-option>
              <el-option label="客户代码" value="6"></el-option>
            </el-select>
            <i slot="prefix" class="iconfont iconpaizhao1"></i>

            <el-button slot="append" icon="el-icon-search" style="height: 47px"
              >查询</el-button
            >
          </el-input>
        </el-col>



      <el-col :span="8">
        <el-button
          size="small"
          style="
            margin-top: 10px;
            margin-bottom: 10px;
            float: right;
            margin-left: 10px;
          "
          type="plain"
          class="setting"
        >
          <div style="display: flex; flex-direction: column">
            <i class="el-icon-setting"></i
            ><span style="margin-top: 3px">打印</span>
          </div>
        </el-button>

        <el-button
          @click="handleImport(2)"
          size="small"
          style="margin-top: 10px; margin-bottom: 10px; float: right"
          type="plain"
          class="setting"
        >
          <div style="display: flex; flex-direction: column">
            <i class="el-icon-setting"></i
            ><span style="margin-top: 3px">导出</span>
          </div>
        </el-button>
        <el-button
          @click="handleImport(1)"
          size="small"
          style="margin-top: 10px; margin-bottom: 10px; float: right"
          type="plain"
          class="setting"
        >
          <div style="display: flex; flex-direction: column">
            <i class="el-icon-setting"></i
            ><span style="margin-top: 3px">导入</span>
          </div>
        </el-button>
        <el-tooltip
          class="item"
          effect="dark"
          content="操作：选择下面列表，然后点击按钮"
          placement="top"
        >
          <el-button
            @click="handleDelCustomer(1)"
            size="small"
            style="margin-top: 10px; margin-bottom: 10px; float: right"
            type="plain"
            class="setting"
          >
            <div style="display: flex; flex-direction: column">
              <i class="el-icon-setting"></i
              ><span style="margin-top: 3px">删除</span>
            </div>
          </el-button>
        </el-tooltip>
        <el-button
          @click="handleSelectionChange"
          size="small"
          style="margin-top: 10px; margin-bottom: 10px; float: right"
          type="plain"
          class="setting"
        >
          <div style="display: flex; flex-direction: column">
            <i class="el-icon-setting"></i
            ><span style="margin-top: 3px">新建订单</span>
          </div>
        </el-button>
      </el-col>
    </div>

    <el-table
      ref="multipleTable"
      :data="tableData"
      border
      stripe
      height="600"
      row-class-name="tableRow"
      header-row-class-name="tableHeader"
      @row-dblclick="handleOpenOrderInfo"
      style="width: 100%; border-top: 1px solid #c5c5c5"
    >
      <el-table-column type="selection" width="55"> </el-table-column>
      <el-table-column prop="id" label="序号" width="50"> </el-table-column>
      <el-table-column prop="sale_no" label="订单单号" width="150">
      </el-table-column>
      <el-table-column prop="wxnr" label="维修内容" width="150">
      </el-table-column>
      <el-table-column prop="date" label="创建日期" width="150">
      </el-table-column>
      <el-table-column prop="kfmc" label="客户名称" width="150">
      </el-table-column>

      <el-table-column prop="status" label="审批状态" width="150">
        <template slot-scope="scope">
          <el-popover trigger="hover" placement="top">
            <p>审批人: {{ scope.row.sale_no }}</p>
            <p>审批时间: {{ scope.row.date }}</p>
            <div slot="reference" class="name-wrapper">
              <el-tag size="medium">{{ scope.row.status }}</el-tag>
            </div>
          </el-popover>
        </template>
      </el-table-column>

      <el-table-column prop="name" label="物品名称" width="120">
      </el-table-column>

      <el-table-column prop="status" label="收款状态" width="150">
        <template slot-scope="scope">
          <div slot="reference" class="name-wrapper" style="color: red">
            {{ scope.row.status }}
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="status" label="出库状态" width="150">
        <template slot-scope="scope">
          <div slot="reference" class="name-wrapper" style="color: blue">
            {{ scope.row.status }}
          </div>
        </template>
      </el-table-column>

      <el-table-column prop="status" label="开票状态" width="150">
      </el-table-column>

      <el-table-column prop="status" label="生成状态" width="150">
      </el-table-column>

      <el-table-column
        v-if="showCustomerCode"
        prop="province"
        label="款号"
        width="120"
      >
      </el-table-column>
      <el-table-column
        v-if="showCustomerCode"
        prop="province"
        label="款号码"
        width="120"
      >
      </el-table-column>
      <el-table-column
        v-if="showCustomerCate"
        prop="address"
        label="物品等级"
        width="120"
      >
      </el-table-column>
      <el-table-column
        v-if="showCustomerStatus"
        prop="city"
        label="金料品类"
        width="120"
      >
      </el-table-column>
      <el-table-column
        v-if="showCreditRank"
        prop="zip"
        label="型号"
        width="120"
      >
      </el-table-column>

      <el-table-column v-if="showContacts" prop="zip" label="规格" width="120">
      </el-table-column>

      <el-table-column v-if="showPhone" prop="zip" label="尺寸" width="120">
      </el-table-column>
      <el-table-column v-if="showPhoneNum" prop="zip" label="颜色" width="120">
      </el-table-column>
      <el-table-column v-if="showWeixin" prop="zip" label="品牌" width="120">
      </el-table-column>

      <el-table-column v-if="showFax" prop="zip" label="货重" width="120">
      </el-table-column>

      <el-table-column
        v-if="showCustomerStaffName"
        prop="zip"
        label="净金重"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showCustomerStaffCode"
        prop="zip"
        label="净足金重"
        width="120"
      >
      </el-table-column>

      <el-table-column v-if="showOperator" prop="zip" label="单位" width="120">
      </el-table-column>

      <el-table-column v-if="showOperator" prop="zip" label="数量" width="120">
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="主石名称"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="主石编号"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="主石数量"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="主石克拉重"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="主石数量"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="主石倍率"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="主石倍率重"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="副石名称"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="副石编号"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="副石数量"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="副石克拉重"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="副石倍率"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="主石数量"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="副石倍率重"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="出厂单价"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="含税出厂价"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="sale_price"
        label="销售单价"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="sale_cate"
        label="销售类别"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="包装方式"
        width="120"
      >
      </el-table-column>

      <el-table-column v-if="showRemark" prop="zip" label="证书" width="120">
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="送货方式"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="送货地点"
        width="120"
      >
      </el-table-column>

      <el-table-column v-if="showRemark" prop="zip" label="收货人" width="120">
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="收货人电话"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="结款方式"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="结料方式"
        width="120"
      >
      </el-table-column>

      <el-table-column v-if="showRemark" prop="zip" label="税率" width="120">
      </el-table-column>

      <el-table-column v-if="showRemark" prop="zip" label="审批人" width="120">
      </el-table-column>

      <el-table-column v-if="showRemark" prop="zip" label="客服" width="120">
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="产品图片"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="版模状态"
        width="120"
      >
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="电绘设计状态"
        width="120"
      >
      </el-table-column>

      <el-table-column v-if="showRemark" prop="zip" label="录单人" width="120">
      </el-table-column>

      <el-table-column
        v-if="showRemark"
        prop="zip"
        label="录单时间"
        width="120"
      >
      </el-table-column>

      <el-table-column v-if="showRemark" prop="zip" label="备注" width="120">
      </el-table-column>
    </el-table>
<div class="block">
      <el-pagination
        @size-change="handleSizeChange1"
        @current-change="handleCurrentChange1"
        :current-page="currentPage1"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="20"
        layout="total, sizes, prev, pager, next, jumper"
        :total="400"
      ></el-pagination></div>




    <order-repair-add
      v-bind:dialogshow="dialogOrderAdd"
      @dialog_close="dialogOrderAdd = !dialogOrderAdd"
    ></order-repair-add>
    <order-repair-info
      v-bind:dialogshow="dialogOrderInfo"
      @dialog_close="dialogOrderInfo = !dialogOrderInfo"
    ></order-repair-info>

    <!-- <send-message v-bind:dialogshow="dialogSendMessage" @dialog_close="send_message_dialog_close"></send-message>
        <send-weixin v-bind:dialogshow="dialogWeixin" @dialog_close="send_weixin_dialog_close"></send-weixin>
        <send-email v-bind:dialogshow="dialogEmail" @dialog_close="send_email_dialog_close"></send-email> -->
  </div>
</template>

<style>
.col-md-12 {
  display: block;
  overflow: hidden;
  background-color: #f5f5f5;
}

.tableHeader th {
  background-color: #f5f5f5 !important;
  /*color: #000000;*/
  /*border-color: #c5c5c5;*/
}

.el-tabs__content {
  padding: 0px !important;
}

.ml-10 {
  margin-left: 10px;
}

.mg-10 {
  margin: 10px;
}

.mr-10 {
  margin-right: 10px;
}
#pricesDialog .el-dialog {
  width: 60%;
}

#pricesManages .el-form-item {
  width: 230px;
  float: left;
  margin-bottom: 5px;
}

#pricesManages .el-form-item .el-form-item__label {
  width: 120px !important;
}

#pricesManages .el-form-item .el-form-item__content {
  margin-left: 120px !important;
}

/*#pricesManages  .el-form-item:nth-child(odd) {*/
/*    float: right;*/
/*}*/

.el-dialog__body,
.el-form {
  overflow: hidden;
}

#pricesDialog .el-form {
  border: 1px solid #c5c5c5;
  padding: 5px;
  margin-top: 10px;
  margin-bottom: 10px;
}

#pricesDialog .el-dialog__footer {
  clear: both;
}

.tableRow {
  cursor: pointer;
}

.upload-demo {
  margin-top: 20px;
}
</style>

<script>
module.exports = {
  methods: {
    handleSizeChange1(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange1(val) {
      console.log(`当前页: ${val}`);
    },
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    handlePreview(file) {
      console.log(file);
    },
    handleExceed(files, fileList) {
      this.$message.warning(
        `当前限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${
          files.length + fileList.length
        } 个文件`
      );
    },
    beforeRemove(file, fileList) {
      return this.$confirm(`确定移除 ${file.name}？`);
    },
    addData() {
      this.tableDatas.push({
        edit: true,
      });
    },
    //确认添加
    confirmAdd(row) {
      row.edit = false;
    },
    //修改
    editData(row) {
      row.edit = true;
    },
    //删除
    deleteData(row, index) {
      this.tableDatas.splice(index, 1);
    },
    handleClick(row) {
      console.log(row);
      console.log(22);
      this.dialogHistoryPricesList = true;
      event.preventDefault();

      event.stopPropagation();
    },
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
      if (columnIndex === 2) {
        return {
          rowspan: row.rowspan,
          colspan: 1,
        };
        // if(this.arrs.indexOf(row.sale_no) === -1){
        //   console.log(row.sale_no)
        //   this.arrs.push(row.sale_no)
        //   console.log(this.arrs)
        //   return {
        //     rowspan: 2,
        //     colspan: 1
        //   };
        // }else {
        //   return {
        //     rowspan: 0,
        //     colspan: 0
        //   };
        // }
      }

      // if (columnIndex === 2) {
      //   console.log(row)
      //   if (rowIndex % 2 === 0) {
      //     return {
      //       rowspan: 2,
      //       colspan: 1
      //     };
      //   } else {
      //     return {
      //       rowspan: 0,
      //       colspan: 0
      //     };
      //   }
      // }
    },
    handleSelectionChange(val) {
      //显示弹框
      console.log(333);
      this.dialogOrderAdd = true;
    },

    handleOpenOrderInfo(val) {
      //显示弹框
      console.log(333);
      this.dialogOrderInfo = true;
    },

    openChangeCustomerDialog(val) {
      this.dialogCostomsChange = true;
    },

    handleDelCustomer(val) {
      // 删除操作
      this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.$message({
            type: "success",
            message: "删除成功!",
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消操作",
          });
        });
    },

    handleImport(val) {
      if (val === 1) {
        //导入操作
        this.$alert("打开文件夹导入工作", "导入", {
          confirmButtonText: "确定",
          callback: (action) => {
            this.$message({
              type: "success",
              message: "导入成功",
            });
          },
        });
      } else if (val === 2) {
        //导出操作
        this.$alert("打开文件夹导出工作", "导出", {
          confirmButtonText: "确定",
          callback: (action) => {
            this.$message({
              type: "success",
              message: "导出表格成功",
            });
          },
        });
      } else if (val === 3) {
        //导出操作
        this.$confirm("提交审核, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.$message({
              type: "success",
              message: "提交成功!",
            });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消操作",
            });
          });
      } else if (val === 4) {
        //导出操作
        this.$confirm("生成订单, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.$message({
              type: "success",
              message: "提交成功!",
            });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消操作",
            });
          });
      }
    },

    handleButtons(val) {
      switch (val) {
        case 1:
          this.dialogSendMessage = "true";
          console.log(this.dialogSendMessage);
          break;
        case 2:
          this.dialogWeixin = "true";
          console.log(this.dialogWeixin);
          break;
        case 3:
          this.dialogEmail = "true";
          console.log(this.dialogEmail);
          break;
        case 4:
          this.dialogChangeCustomer = "true";
          console.log(this.dialogChangeCustomer);
          break;
        case 6:
          this.$confirm("是否继续操作?", "提示", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
            .then(() => {
              this.$message({
                type: "success",
                message: "操作成功!",
              });
            })
            .catch(() => {
              this.$message({
                type: "info",
                message: "已取消",
              });
            });
          break;
      }
    },
    handleChangeCustomer(val) {
      this.dialogChangeCustomer = "true";
      console.log(this.dialogChangeCustomer);
    },
    dialogAdd() {
      console.log(123);
    },
    getSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "总价";
          return;
        }
        const values = data.map((item) => Number(item[column.property]));
        if (!values.every((value) => isNaN(value))) {
          sums[index] = values.reduce((prev, curr) => {
            const value = Number(curr);
            if (!isNaN(value)) {
              return prev + curr;
            } else {
              return prev;
            }
          }, 0);
          sums[index] += " 元";
        } else {
          sums[index] = "";
        }
      });

      return sums;
    },
    showHide(text) {
      console.log(text);
    },
    send_message_dialog_close(val) {
      console.log(val);
      this.dialogSendMessage = false;
    },
    send_weixin_dialog_close(val) {
      this.dialogWeixin = false;
    },
    send_email_dialog_close(val) {
      this.dialogEmail = false;
    },
    change_customer_dialog_close(val) {
      console.log(val);
      this.dialogChangeCustomer = false;
    },
  },

  data() {
    return {
      currentPage1: 10,
      arrs: [],
      tableDatas: [],
      fileList: [],
      dialogCostoms: false,
      dialogSendMessage: false,
      dialogWeixin: false,
      dialogEmail: false,
      dialogOrderAdd: false,
      dialogOrderInfo: false,
      fullscreen: false,
      scheduleType: [{ typename: "清理库存" }, { typename: "节日促销" }],
      historyPrices: [
        {
          date: "2019-05-02",
          name: "100",
          typename: "清理库存",
          address: "2019-05-02 - 2020-01-01",
        },
        {
          date: "2020-01-02",
          name: "90",
          typename: "节日促销",
          address: "2020-01-02 - 2020-02-01",
        },
      ],
      customer: {
        adjust_time: "",
        name: "",
        customercode: "",
        customerstatus: "",
        customercate: "",
        creditrank: "",
        creditline: "",
        capital: "",
        annualsales: "",
        bank: "",
        certificateno: "",
        address: "",
        area: "",
        brand: "",
        bankaccount: "",
        trademark: "",
        website: "",
        lperson: "",
        lphone: "",
        contacts: "",

        phone: "",
        phonenum: "",
        weixin: "",
        email: "",
        fax: "",
        resource: "",
        requirement: "",
        ordercountmonth: "",
        purchaseamountmonth: "",
        ordercountyear: "",
        purchaseamountyear: "",
        customerstaffname: "",
        customerstaffcode: "",
        operator: "",
        insertime: "",
        remark: "",
      },

      form: {
        typeId: "",
      },

      select: {
        name: "",
        introduce: "",
        cooperative_brand: "",
        customer_status: "",
        customer_level: "",
        now_principal_id: "",
        last_follow_up_date: "",
        create_date: "",
      },

      crmsclientStatic: [
        { typename: "类别一" },
        { typename: "类别二" },
        { typename: "类别三" },
      ],

      crmsclientRank: [
        { typename: "A类" },
        { typename: "B类" },
        { typename: "C类" },
        { typename: "D类" },
      ],

      customerstaffs: [
        { typename: "客服1" },
        { typename: "客服2" },
        { typename: "客服3" },
        { typename: "客服4" },
      ],

      changeReason: [
        { typename: "交接原因一" },
        { typename: "交接原因二" },
        { typename: "交接原因三" },
        { typename: "其他" },
      ],

      options1: [],

      pickerOptions2: {
        shortcuts: [
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      }, //日期控件
      pickerOptions1: {
        disabledDate(time) {
          return time.getTime() > Date.now();
        },
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              picker.$emit("pick", new Date());
            },
          },
          {
            text: "昨天",
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", date);
            },
          },
          {
            text: "一周前",
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", date);
            },
          },
        ],
      }, //首次合作日期

      showCustomerCode: true,
      showCustomerStatus: true,
      showCustomerCate: true,
      showCreditRank: true,
      showCreditLine: true,
      showCapital: true,
      showAnnualSales: true,
      showBank: true,
      showCertificateNo: true,
      showAddress: true,
      showArea: true,
      showBrand: true,
      showBankAccount: true,
      showTrademark: true,
      showWebsite: true,
      showLperson: true,
      showLphone: true,
      showContacts: true,
      showPhone: true,
      showPhoneNum: true,
      showWeixin: true,
      showEmail: true,
      showFax: true,
      showResource: true,
      showRequirement: true,
      showOrderCountMonth: true,
      showPurchaseAmountMonth: true,
      showOrderCountYear: true,
      showPurchaseAmountYear: true,
      showCustomerStaffName: true,
      showCustomerStaffCode: true,
      showOperator: true,
      showInsertime: true,
      showRemark: true,

      tableData: [
        {
          date: "2016-05-02",
          id: "1",
          sale_no: "12987126",

          name: "物品一",
          status: "审批中",
          sale_type: "现货",
          province: "BC1001",
          city: "足金999",
          address: "A类",
          zip: "",
          sale_price: "10.00",
          ex_factory_price: "3%",
          sale_cate: "打折",
        },
        {
          id: "2",
          sale_no: "12987126",

          date: "2016-05-04",
          name: "物品一2",
          sale_type: "订单",
          status: "代审批",
          province: "BC1002",
          city: "足金999",
          address: "A类",
          sale_price: "11.00",
          ex_factory_price: "8%",
          sale_cate: "批发",
          zip: "",
        },
        {
          id: "3",
          sale_no: "12987126",

          date: "2016-05-01",
          name: "物品一3",
          status: "已审批",
          sale_type: "订单",
          province: "BC1003",
          city: "足金999",
          address: "A类",
          sale_price: "10.00",
          ex_factory_price: "11%",
          sale_cate: "零售",
          zip: "",
        },
        {
          id: "4",
          sale_no: "12987127",

          date: "2016-05-03",
          name: "物品一4",
          sale_type: "现货",
          status: "审批中",
          province: "BC1004",
          city: "足金999",
          sale_price: "10.00",
          address: "A类",
          ex_factory_price: "13%",
          sale_cate: "其他",
          zip: "",
        },
        {
          id: "5",
          sale_no: "12987128",
          date: "2016-05-03",
          name: "物品一4",
          sale_type: "现货",
          status: "审批中",
          province: "BC1004",
          city: "足金999",
          sale_price: "10.00",
          address: "A类",
          ex_factory_price: "13%",
          sale_cate: "其他",
          zip: "",
        },
      ],
      multipleSelection: [],
    };
  },

  components: {
    // 'send-message': 'url:./send-message.vue',
    // 'send-weixin': 'url:./send-weixin.vue',
    // 'send-email': 'url:./send-email.vue',
    "order-repair-add": "url:./dialog/order-repair-add.vue",
    "order-repair-info": "url:./dialog/order-repair-info.vue",
  },
};
//alert(1);
</script>



